package com.penglecode.java7.features.syntax;
/**
 * 在Java7中,整数类型(byte,short,int,long)可以用以0b或0B开头的二进制形式来表示
 * 如：	byte aByte = (byte)0b00100001;
 * 		short aShort = (short)0b1010000101000101;
 * @author pengpeng
 * @date 2013-7-22下午4:12:59
 * @version 1.0
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class BinaryLiteralsTest {

	public static void main(String[] args) {
		byte b = (byte)0b00010010;
		System.out.println(">>> byte : " + b);
		short s = (short) 0b0111111111111111;
		System.out.println(">>> short : " + s);
		System.out.println(Short.MAX_VALUE);
		System.out.println(Integer.toBinaryString(Short.MAX_VALUE));
		
		int i = 0B010010001;
		System.out.println(i);
	}

}
